package com.easy.activiti.ext;

import com.easy.activiti.command.DynamicJumpCmd;
import com.easy.activiti.command.RejectCmd;
import org.activiti.engine.ManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author zhouchuang
 * 2024-11-07 14:31:11
 */
@Service
public class DynamicJumpService {
    @Autowired
    protected ManagementService managementService;

    public void jumpTask(String processInstanceId, String fromActivityId, String toActivityId) {
        DynamicJumpCmd dynamicJumpCmd = new DynamicJumpCmd(processInstanceId, fromActivityId, toActivityId);
        managementService.executeCommand(dynamicJumpCmd);
    }
    public void reject(String processInstanceId) {
        RejectCmd rejectCmd = new RejectCmd(processInstanceId);
        managementService.executeCommand(rejectCmd);
    }
}
